using System.Data.Entity.ModelConfiguration;

namespace OBUCare.Core.Models.Mapping
{
    public class View_TRANSFER_BILL_InfoMap : EntityTypeConfiguration<View_TRANSFER_BILL_Info>
    {
        public View_TRANSFER_BILL_InfoMap()
        {
            // Primary Key
            this.HasKey(t => new { t.ID});

            

            this.Property(t => t.TRANSFER_BILL_NO)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.OPERATOR_NO)
                .IsFixedLength()
                .HasMaxLength(6);

            this.Property(t => t.Deliver_OPERATOR)
                .HasMaxLength(50);

            this.Property(t => t.SEND_PEOPLE)
                .HasMaxLength(20);

            this.Property(t => t.RECEIVE_OPERATOR_NO)
                .IsFixedLength()
                .HasMaxLength(6);

            this.Property(t => t.RECEIVE_OPERATOR)
                .HasMaxLength(50);

            this.Property(t => t.TRANSFER_TYPE_Title)
                .HasMaxLength(50);

            this.Property(t => t.TRANSFER_FROM)
                .HasMaxLength(50);

            this.Property(t => t.TRANSFER_FROM_NAME)
                .HasMaxLength(200);

            //this.Property(t => t.TransferFromAgent)
            //    .HasMaxLength(50);

            //this.Property(t => t.TransferFromSupplier)
            //    .HasMaxLength(200);

            this.Property(t => t.TRANSFER_TO)
                .HasMaxLength(50);

            this.Property(t => t.TRANSFER_TO_NAME)
                .HasMaxLength(200);

            //this.Property(t => t.TransferToAgent)
            //    .HasMaxLength(50);

            //this.Property(t => t.TransferToSupplier)
            //    .HasMaxLength(200);           

            this.Property(t => t.STATUS_title)
                .HasMaxLength(50);

            this.Property(t => t.CREATED_BY)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(6);

            this.Property(t => t.MODIFY_BY)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(6);

            this.Property(t => t.Agent)
                .HasMaxLength(50);

            this.Property(t => t.Agent_Title)
                .HasMaxLength(50);

            this.Property(t => t.Supplier)
                .HasMaxLength(50);

            this.Property(t => t.Supplier_Title)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("View_TRANSFER_BILL_Info");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.TRANSFER_BILL_NO).HasColumnName("TRANSFER_BILL_NO");
            this.Property(t => t.OPERATOR_NO).HasColumnName("OPERATOR_NO");
            this.Property(t => t.Deliver_OPERATOR).HasColumnName("Deliver_OPERATOR");
            this.Property(t => t.TRANSFER_DATE).HasColumnName("TRANSFER_DATE");
            this.Property(t => t.SEND_PEOPLE).HasColumnName("SEND_PEOPLE");
            this.Property(t => t.SEND_DATE).HasColumnName("SEND_DATE");
            this.Property(t => t.RECEIVE_OPERATOR_NO).HasColumnName("RECEIVE_OPERATOR_NO");
            this.Property(t => t.RECEIVE_OPERATOR).HasColumnName("RECEIVE_OPERATOR");
            this.Property(t => t.CONFIRM_DATE).HasColumnName("CONFIRM_DATE");
            this.Property(t => t.TRANSFER_TYPE).HasColumnName("TRANSFER_TYPE");
            this.Property(t => t.TRANSFER_TYPE_Title).HasColumnName("TRANSFER_TYPE_Title");
            this.Property(t => t.TRANSFER_FROM).HasColumnName("TRANSFER_FROM");
            this.Property(t => t.TRANSFER_FROM_NAME).HasColumnName("TRANSFER_FROM_NAME");
            //this.Property(t => t.TransferFromAgent).HasColumnName("TransferFromAgent");
            //this.Property(t => t.TransferFromAgentType).HasColumnName("TransferFromAgentType");
            //this.Property(t => t.TransferFromSupplier).HasColumnName("TransferFromSupplier");
            this.Property(t => t.TRANSFER_TO).HasColumnName("TRANSFER_TO");
            this.Property(t => t.TRANSFER_TO_NAME).HasColumnName("TRANSFER_TO_NAME");
            this.Property(t => t.AGENT_TYPE_NO).HasColumnName("AGENT_TYPE_NO");
            //this.Property(t => t.TransferToAgent).HasColumnName("TransferToAgent");
            //this.Property(t => t.TransferToAgentType).HasColumnName("TransferToAgentType");
            //this.Property(t => t.TransferToSupplier).HasColumnName("TransferToSupplier");
            this.Property(t => t.STATUS).HasColumnName("STATUS");
            this.Property(t => t.STATUS_title).HasColumnName("STATUS_title");
            this.Property(t => t.CREATED_BY).HasColumnName("CREATED_BY");
            this.Property(t => t.CREATED_DATE).HasColumnName("CREATED_DATE");
            this.Property(t => t.MODIFY_BY).HasColumnName("MODIFY_BY");
            this.Property(t => t.MODIFY_DATE).HasColumnName("MODIFY_DATE");
            this.Property(t => t.Agent).HasColumnName("Agent");
            this.Property(t => t.Agent_Title).HasColumnName("Agent_Title");
            this.Property(t => t.Agent_Type).HasColumnName("Agent_Type");
            this.Property(t => t.Supplier).HasColumnName("Supplier");
            this.Property(t => t.Supplier_Title).HasColumnName("Supplier_Title");
        }
    }
}
